import 'package:json_annotation/json_annotation.dart';
import 'package:flutter_module/http/req_model.dart';
import 'package:flutter_module/config/api.dart';


part 'Entity.g.dart';

/*
* 机器表 - 请求
* */

class EntityReqModel extends ReqModel {
  @override
  String urlWithUUID(String uuid) => API.timelineService+uuid;

  @override
  Map params() => {};

  Future data(String uuid) => getWithUUID(uuid);
}

@JsonSerializable()
class Entity extends Object {

  bool success;

  String message;

  int code;

  Result result;

  int timestamp;

  Entity(this.success,this.message,this.code,this.result,this.timestamp,);

  factory Entity.fromJson(Map<String, dynamic> srcJson) => _$EntityFromJson(srcJson);

  Map<String, dynamic> toJson() => _$EntityToJson(this);

}


@JsonSerializable()
class Result extends Object {

  List<App_esp_ip> app_esp_ip;

  Result(this.app_esp_ip,);

  factory Result.fromJson(Map<String, dynamic> srcJson) => _$ResultFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ResultToJson(this);

}


@JsonSerializable()
class App_esp_ip extends Object {

  String id;

  String appUuid;

  String chipid;

  String ip;

  String subscribe;

  String time;

  String macAddress;

  String softAPmacAddress;

  String productName;

  String ysyserialnumber;

  String ysyappkey;

  int expireTime;

  String wifiname;

  String wifipassword;

  int level;

  String espType;

  bool expire;

  bool share;

  bool line;

  bool bind;

  String fromshareuser;

  App_esp_ip(this.id,this.appUuid,this.chipid,this.ip,this.subscribe,this.time,this.macAddress,this.softAPmacAddress,this.productName,this.ysyappkey,this.ysyserialnumber,this.expireTime,this.wifiname,this.wifipassword,this.level,this.espType,this.expire,this.share,this.line,this.bind,this.fromshareuser);

  factory App_esp_ip.fromJson(Map<String, dynamic> srcJson) => _$App_esp_ipFromJson(srcJson);

  Map<String, dynamic> toJson() => _$App_esp_ipToJson(this);

}


